let module1 = (function() {
    //模块列表集合
    const moduleLists = {};
    function define(name, modules, action) {
      modules.map((m, i) => {
        modules[i] = moduleLists[m];
      });
      //执行并保存模块
      moduleLists[name] = action.apply(null, modules);
      console.log("moduleLists-name:");
      console.log(moduleLists[name]);
      
      console.log(moduleLists[name].__proto__);
      console.log(modules);
    }
    return { define };
  })();
//声明模块不依赖其它模块
module1.define("hd", [], function() {
  return {
    show() {
      console.log("hd module show1");
    }
  };
});
//声明模块不依赖其它模块
module1.define("hd2", ["hd"], function(hd) {
  hd.show();
  return {
    show() {
      console.log("hd module show2");
    }
  };
});

//声明模块时依赖其它模块
module1.define("xj", ["hd","hd2"], function(hd,hd2) {
  hd2.show();
});


